import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

// 公共路由
export const constantRoutes = [
  {
    path: "/",
    component: (resolve) => require(["@/views/index"], resolve),
    meta: { title: "主页" },
  },
  {
    path: "/participation",
    component: (resolve) => require(["@/views/participation"], resolve),
    meta: { title: "参与抽奖页面" },
  },
  {
    path: "/number-ball",
    component: (resolve) => require(["@/views/number-ball/index"], resolve),
    meta: { title: "抽奖" },
  },
  {
    path: "/program-voting",
    component: (resolve) =>
      require(["@/views/number-ball/program-voting"], resolve),
    meta: { title: "节目投票" },
  },
];

export default new Router({
  mode: "history", // 去掉url中的#
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes,
});
